<template>
  <div>
    <up-down-layout :header="'体系文件列表'" :handleFlag="true" >
      <template slot="query">
        <search-form :componentList="componentList" :formValue="queryParas" @handleFilter="handleFilter"
          @clearParam="clearParam">
        </search-form>
      </template>
      <template slot="table">
        <!-- table表格 -->
        <data-table :toolMenuFlag="true" @onCreateRow="addData" :sourceData="sourceData" :queryParas="queryParas"
          @onEditRow="onEditRow" :menuFlag="false" :IsRight="false" :operateBtnLayout="operateBtnLayout"
          :columns="columns" :deleteApi="api" :api="api" :loadCount="loadCount" :operatWidth="'180px'"
          >
          <template scope-slot="button" v-slot:button="row" >
            <el-button icon="el-icon-share"  class="iconCircle" title="文件权限" @click="fileAuth(row)"></el-button>
            <el-button icon="el-icon-document"  class="iconCircle" title="文件管理" @click="fileManager(row)"></el-button>
          </template>
        </data-table>
      </template>
    </up-down-layout>
    <!-- 体系新增弹窗 -->
    <systemEdit :editModel="editModel" :visible.sync="dialogVisible" :api="api" :form="item" @handSearch="handleFilter"/>
    <!-- 体系权限管理 -->
    <privilegeManage :id="id" :bizType="bizType" :bizTypeName="bizTypeName"  :editModel="editModel" :visible.sync="dialogVisiblePrivilger" v-if="dialogVisiblePrivilger" :api="api" :form="item" @handSearch="handleFilter"/>
    <!-- 文件夹管理 -->
    <el-drawer
      title=""
      :visible.sync="drawer"
      size="80%" class="file-drawer"
      direction='btt'
      :with-header="true">
      <!-- 体系文件目录-->
      <fileSystem :authOpt="'M'" :bizId ="bizId" :bizType="bizType" class="file-content" :bizTypeName = "bizTypeName"></fileSystem>
    </el-drawer>
  </div>
</template>
<script>
import BaseManage from '@/pages/baseManage'
import upDownLayout from '@/components/element/upDownLayout'
import searchForm from '@/components/element/searchForm'
import DataTable from '@/components/element/DataTable'
// import businessApi from '@/api/business/businessApi'
import systemEdit from '@/pages/fileManage/systemEdit'
import fileSystem from '@/pages/fileManage/fileSystem/fileSystem'
import privilegeManage from '@/pages/fileManage/privilegeManage'
import { fileManageApi } from '@/api/business/businessApi'
export default {
  // 继承baseManage里的公共方法和定义的属性
  extends: new BaseManage(),
  name: 'fileList',
  components: {
    upDownLayout,
    searchForm,
    DataTable,
    systemEdit,
    fileSystem,
    privilegeManage
  },
  data () {
    return {
      drawer: false,
      bizId: '',
      bizType: '',
      bizTypeName: '',
      dialogVisiblePrivilger: false,
      componentList: [
      ],
      queryParas: {
        createTime: '',
        oweOrgName: '',
        useOrgId: ''
      },
      // talbe显示的每一项
      columns: [
      ],
      // 操作列需要显示的按钮
      operateBtnLayout: 'C,E,D'
    }
  },
  computed: {
    api () {
      return fileManageApi
    }
  },
  created () {
  },
  methods: {
  }
}
</script>
<style lang="scss" scope>
  .file-drawer .el-drawer__header {
    margin-bottom: 10px;
    background: rgb(248, 248, 248);
  }
  .file-content {
    margin: 0 20px 0 15px;
  }
</style>
